A SoC technology integrates a Central Processing Unit/Micro Process Unit (CPU/PU), a Digital Signal Processor (DSP), a hardware accelerator, a memory, a peripheral interface and other subsystems into a chip through bus interconnection. Besides a local private storage/buffer needed for internal data processing, these subsystems often need to share a centralized storage/buffer for a variety of reasons, for example, data interaction buffering is required among these subsystems; for another example, these subsystems share a memory for processing multi-user services.
These centralized buffers shared by multiple sources/multiple users can be one or several storage units physically, such as a Static Random-Access Memory (SRAM), or a Dynamic Random-Access Memory (DRAM), or several combinations of them, but they can be regarded as a shared buffer logically. The shared buffer described below is discussed on a basis that it is logically a storage unit, but actually it physically can be a storage unit or a combination of several storage units.
Like any public resource, sharing a buffer by multiple sources/multiple users needs to consider allocation and management of storage resources.
At present, a method of using a shared buffer in a SoC design is basically dividing the shared buffer into N fragments with the same size; the size of such a fragment is required to be capable of holding the minimum data needed by each source/each user; big data occupies M fragments, wherein M is an integer, and M is less than or equal to N.
This method is disadvantaged in needing a very large storage space to record a use state and storage location information of each fragment. Especially, when the length of the minimum data needed by a system is very short, the space for storage of each fragment is also very small; when big data is stored, many fragments are needed. In addition, this method wastes a shared buffer space, for example, some data are only a little bit bigger than an integral number of fragments, and need to be stored in another single fragment.